Developer Documentation

QuickTime 4 API Documentation

QuickTime 4 Reference

| Previous | Chapter Contents | Chapter Top | Next |

Vector Codec Component Functions

The following functions are provided by the vector codec component.

CurveAddAtomToVectorStream

You use the CurveAddAtomToVectorStream function to add an atom to a vector data stream.

pascal ComponentResult CurveAddAtomToVectorStream (
                     ComponentInstance effect,
                     OSType atomType,
                     Size atomSize,
                     void *pAtomData,
                     Handle vectorStream);
effect
Specifies the instance of the QuickTime vector codec component for the request. Your software obtains this reference when calling the Component Manager's OpenComponent or OpenDefaultComponent function.

atomType
Specifies the type of atom to add to the vector data stream.

atomSize
Specifies the size of the data for the atom.

pAtomData
Contains a pointer to the data for the atom.

vectorStream
Contains a handle to the vector data stream to which to add the atom.

DISCUSSION

This function adds the atom to the end of the specified vector data stream and resizes the vector data stream handle.

CurveAddPathAtomToVectorStream

You use the CurveAddPathAtomToVectorStream function to add a path to a vector data stream.

pascal ComponentResult CurveAddPathAtomToVectorStream (
                     ComponentInstance effect,
                     Handle pathData,
                     Handle vectorStream);
effect
Specifies the instance of the QuickTime vector codec component for the request. Your software obtains this reference when calling the Component Manager's OpenComponent or OpenDefaultComponent function.

pathData
Contains a handle to the data for the path.

vectorStream
Contains a handle to the vector data stream to which to add the path.

DISCUSSION

This function adds the path to the end of the specified vector data stream and resizes the vector data stream handle.

CurveAddZeroAtomToVectorStream

You use the CurveAddZeroAtomToVectorStream function to add a kCurveEndAtom to a vector data stream. This atom marks the end of the vector data stream,

pascal ComponentResult CurveAddZeroAtomToVectorStream (
                     ComponentInstance effect,
                     Handle vectorStream);
effect
Specifies the instance of the QuickTime vector codec component for the request. Your software obtains this reference when calling the Component Manager's OpenComponent or OpenDefaultComponent function.

vectorStream
Contains a handle to the vector data stream to which to add the kCurveEndAtom atom.

DISCUSSION

This function adds a kCurveEndAtom atom to the end of the specified vector data stream and resizes the vector data stream handle. The kCurveEndAtom atom is required at the end of a vector data stream, and there may be only one kCurveEndAtom atom in the stream.

CurveCountPointsInPath

You use the CurveCountPointsInPath function to count the points along either one of a path's contours or all of its contours.

pascal ComponentResult CurveCountPointsInPath (
                     ComponentInstance effect,
                     gxPaths *aPath,
                     unsigned long contourIndex,
                     unsigned long *pCount);
effect
Specifies the instance of the QuickTime vector codec component for the request.

aPath
Contains pointer to the path.

contourIndex
Contains the index of the contour to be counted.

pCount
Contains a pointer to a field that is to receive the number of points in the contour or path.

CurveCreateVectorStream

You use the CurveCreateVectorStream function to create a new, empty vector data stream.

pascal ComponentResult CurveCreateVectorStream (
                     ComponentInstance effect,
                     Handle *pStream);
effect
Specifies the instance of the QuickTime vector codec component for the request. Your software obtains this reference when calling the Component Manager's OpenComponent or OpenDefaultComponent function.

pStream
Contains a pointer to the handle that is to receive the newly created vector data stream.

DISCUSSION

The caller is responsible for disposing of the stream when finished with it. This can be done by calling the DisposeHandle function.

CurveGetAtomDataFromVectorStream

You use the CurveGetAtomDataFromVectorStream function to find the first atom of a specified type within a vector data stream and get its data.

pascal ComponentResult CurveGetAtomDataFromVectorStream (
                     ComponentInstance effect,
                     Handle vectorStream,
                     long atomType,
                     long *dataSize,
                     Ptr *dataPtr);
effect
Specifies the instance of the QuickTime vector codec component for the request. Your software obtains this reference when calling the Component Manager's OpenComponent or OpenDefaultComponent function.

vectorStream
Contains a handle to the vector data stream from which to get the atom.

atomType
Specifies the type of atom to find.

dataSize
Contains a pointer to a field that is to receive the size of the atom's data.

dataPtr
Contains a pointer to a pointer to a field that is to receive the atom's data.

DISCUSSION

Before calling this function, your software must lock the handle for the vector data stream (by calling the HLock function). This prevents the handle from being moved, which could invalidate the pointer to the atom data before your software gets the data.

CurveGetLength

You use the CurveGetLength function to calculate the length of one of a path's contours or the sum of the lengths of all of its contours.

pascal ComponentResult CurveGetLength (
                     ComponentInstance effect,
                     gxPaths *target,
                     long index,
                     wide *wideLength);
effect
Specifies the instance of the QuickTime vector codec component for the request. Your software obtains this reference when calling the Component Manager's OpenComponent or OpenDefaultComponent function.

target
Contains a pointer to the path.

index
Contains the index of the contour whose length is to be calculated or, if the value is 0 , specifies to calculate the lengths of all of the path's contours and return the sum of the lengths.

wideLength
Contains a pointer to a field that is to receive the length.

CurveGetNearestPathPoint

You use the CurveGetNearestPathPoint function to find the closest point on a path to a specified point.

pascal ComponentResult CurveGetNearestPathPoint (
                     ComponentInstance effect,
                     gxPaths *aPath,
                     FixedPoint *thePoint,
                     unsigned long *contourIndex,
                     unsigned long *pointIndex,
                     Fixed *theDelta);
effect
Specifies the instance of the QuickTime vector codec component for the request. Your software obtains this reference when calling the Component Manager's OpenComponent or OpenDefaultComponent function.

aPath
Contains a pointer to the path.

thePoint
Contains a pointer to a point for which to find the closest point on the path.

contourIndex
Contains a pointer to a field that is to receive the index of the contour that contains the closest point.

pointIndex
Contains a pointer to a field that is to receive the index of the closest point.

theDelta
Contains a pointer to a field that is to receive the distance between the specified point and the closest point in the contour to it.

DISCUSSION

In programs where users directly manipulate curves, you can use this function to determine the closest control point to a given point.

CurveGetPathPoint

You use the CurveGetPathPoint function to get a point from a path and to find out if the point is on the curve.

pascal ComponentResult CurveGetPathPoint (
                     ComponentInstance effect,
                     gxPaths *aPath,
                     unsigned long contourIndex,
                     unsigned long pointIndex,
                     gxPoint *thePoint,
                     Boolean *ptIsOnPath);
effect
Specifies the instance of the QuickTime vector codec component for the request. Your software obtains this reference when calling the Component Manager's OpenComponent or OpenDefaultComponent function.

aPath
Contains a pointer to the path.

contourIndex
Specifies the index of the contour from which to get the point.

pointIndex
Specifies the index of the point to get.

thePoint
Contains a pointer to a field that is to receive the point.

ptIsOnPath
Contains a pointer to a field that is to receive a Boolean value that, if TRUE , specifies that the point is on the curve.

DISCUSSION

This function lets programs get a single point from a path without walking the path data.

CurveInsertPointIntoPath

You use the CurveInsertPointIntoPath function to add a new point to a path.

pascal ComponentResult CurveInsertPointIntoPath (
                     ComponentInstance effect,
                     gxPoint *aPoint,
                     Handle thePath,
                     unsigned long contourIndex,
                     unsigned long pointIndex,
                     Boolean ptIsOnPath);
effect
Specifies the instance of the QuickTime vector codec component for the request. Your software obtains this reference when calling the Component Manager's OpenComponent or OpenDefaultComponent function.

aPoint
Contains a pointer to the point to add to the path.

thePath
Contains a handle to the path to which to add the point.

contourIndex
Specifies the index of the path contour to which to add the point.

pointIndex
Specifies the index of the point to add.

ptIsOnPath
If TRUE , specifies that the new point is to be on the path.

DISCUSSION

This function is best for adding a single point to a path rather than large numbers of points.

CurveLengthToPoint

You use the CurveLengthToPoint function to get the point at a specified distance along a curve.

pascal ComponentResult CurveLengthToPoint (
                     ComponentInstance effect,
                     gxPaths *target,
                     long index,
                     Fixed length,
                     FixedPoint *location,
                     FixedPoint *tangent);
effect
Specifies the instance of the QuickTime vector codec component for the request. Your software obtains this reference when calling the Component Manager's OpenComponent or OpenDefaultComponent function.

target
Contains a pointer to the path.

index
Specifies the index of the path contour from which to get the point.

length
Specifies the distance along the curve at which to find the point.

location
Contains a pointer to a field that is to receive the point.

tangent
Contains a pointer to a field that is to receive a point that is tangent to the point at the specified distance.

DISCUSSION

This function is useful for converting a value to a point, such as when creating an animation that follows a curve.

CurveNewPath

You use the CurveNewPath function to create a new path.

pascal ComponentResult CurveNewPath (
                     ComponentInstance effect,
                     Handle *pPath);
effect
Specifies the instance of the QuickTime vector codec component for the request. Your software obtains this reference when calling the Component Manager's OpenComponent or OpenDefaultComponent function.

pPath
Contains a pointer to a handle that is to receive the new path.

DISCUSSION

The path created by this function contains one contour and no points. The caller must dispose of the handle when it is finished with it by calling the DisposeHandle function.

CurvePathPointToLength

You use the CurvePathPointToLength function to get the length of a path between specified starting and ending distances that is nearest a point.

pascal ComponentResult CurvePathPointToLength (
                     ComponentInstance ci,
                     gxPaths *aPath,
                     Fixed startDist,
                     Fixed endDist,
                     FixedPoint *thePoint,
                     Fixed *pLength );
ci
Specifies the instance of the QuickTime vector codec component for the request. Your software obtains this reference when calling the Component Manager's OpenComponent or OpenDefaultComponent function.

aPath
Contains a pointer to the path.

startDist
Specifies the distance along the path at which to start measuring the path's length.

endDist
Specifies the distance along the path at which to stop measuring the path's length.

thePoint
Contains a pointer to a point; the function measures the path closest to this point.

pLength
Contains a pointer to a field that is to receive the length of the specified part of the path.

DISCUSSION

You can use this function to test if the user has clicked on the specified portion of the curve.

CurveSetPathPoint

You use the CurveSetPathPoint function to change to location of a point in a path.

pascal ComponentResult CurveSetPathPoint (
                     ComponentInstance effect,
                     gxPaths *aPath,
                     unsigned long contourIndex,
                     unsigned long pointIndex,
                     gxPoint *thePoint,
                     Boolean ptIsOnPath);
effect
Specifies the instance of the QuickTime vector codec component for the request. Your software obtains this reference when calling the Component Manager's OpenComponent or OpenDefaultComponent function.

aPath
Contains a pointer to the path.

contourIndex
Specifies the index of the path contour that contains the point to change.

pointIndex
Specifies the index of the point to change.

thePoint
Contains a pointer to the new value for the point.

ptIsOnPath
If TRUE , specifies that the new point is to be on the path.

DISCUSSION

This function edits an existing point location within a path.


© 1999 Apple Computer, Inc.

| Previous | Chapter Contents | Chapter Top | Next |